<?php

namespace User\Controller\Plugin;

use Zend\Mvc\Controller\Plugin\AbstractPlugin;
use Zend\Authentication\AuthenticationService;

class AuthenticationPlugin extends AbstractPlugin {
	/**
	 * @var AuthenticationService
	 */
	protected $authService;

	/**
	 * @return bool
	 */
	public function hasIdentity() {
		return $this->getAuthService()->hasIdentity();
	}

	/**
	 * @return mixed
	 */
	public function getIdentity() {
		return $this->getAuthService()->getIdentity();
	}

	/**
	 * @return AuthenticationService
	 */
	public function getAuthService() {
		return $this->authService;
	}

	/**
	 * @param AuthenticationService $authService
	 */
	public function setAuthService(AuthenticationService $authService) {
		$this->authService = $authService;
		return $this;
	}
}